<include file="Public:header" />
<script type="text/javascript" src="__PUBLIC__/admin/js/engine.js"></script>
<script type="text/javascript" src="__PUBLIC__/admin/js/jq_validate.js"></script>
<script type="text/javascript">
$(function(){
	$('#role_id').validate('selectRequired','请选择所属角色').validate();
	$('#username').validate('required','请填写用户名').validate('minlength',1,'用户名长度1~60个字符').validate('maxlength',60,'用户名长度1~60个字符').validate();
	$('#password').validate('required','请填写密码').validate('minlength',6,'密码长度至少6个字符').validate();
	$('#passwordAgain').validate('required','请再次填写密码').validate('custome',function(value){
			 if(value==$('#password').val()){return true;}else{return false;}
		},'两次输入的密码不一致，请重新输入').validate();
	$('#true_name').validate('required','请填写姓名').validate();		
	$('#dataForm').submitValidate();	
});
</script>
<body class="mainBackground">
	<include file="Public:menu" />
	<div class="main" id="mainContainer">
        <!--发布-->
    	<div class="content_box">
        	<div class="content_box_t">
            	<h3 class="fl">
                <neq name="data[id]" value=''>
                编辑<else/>新增</neq>账号
                </h3>
            </div>
            <div class="content_box_c">
            	<form action="__ACTION__" method="post" id="dataForm" name="dataForm">
                	<div class="field pt15">
						<label>所属角色</label>
						<select name="role_id" class="public_dropdown small_input" id="role_id"  type="select-one">
        					<option value="0">请选择所属角色</option>
            				 <volist name="allRoleArr" id="role">
                               
                            	<option value="{$role.id}" <eq name="role.id" value="$data[role_id]">selected</eq> >{$role.name}</option>
                            </volist>
						</select>
                        <span class="input_notification  png_bg" id="role_idTip"></span>
                        <small>选择所属角色，限定账号权限</small>
					</div>                                         
                	<div class="field pt15">
						<label>用户名</label>
                         <eq name="data[id]" value=''>
                         <input class="text_input w15_input" type="text" name="username" id="username" value="{$data.username}" />
                        <span class="input_notification  png_bg" id="usernameTip"></span>
						<small>必填</small>
                         <else/>
                         {$data.username}
                         </eq>
						
					</div>
                     <eq name="data[id]" value=''>
                     <div class="field pt15">
						<label>密码</label>
						<input class="text_input w15_input" type="password" name="password" id="password" value="" />
                        <span class="input_notification  png_bg" id="passwordTip"></span>
						<small>必填</small>
					</div>
                	<div class="field pt15">
						<label>再次输入密码</label>
						<input class="text_input w15_input" type="password" name="passwordAgain" id="passwordAgain" value="" />
                        <span class="input_notification  png_bg" id="passwordAgainTip"></span>
					</div>  
                     </eq> 
                	<div class="field pt15">
						<label>姓名</label>
						<input class="text_input w15_input" type="text" name="true_name" id="true_name" value="{$data.true_name}" />
                        <span class="input_notification  png_bg" id="true_nameTip"></span>
						<small>必填</small>
					</div>                    
                	<div class="field pt15">
						<label>电子邮箱</label>
						<input class="text_input w15_input" type="text" name="email" id="email" value="{$data.email}" />
					</div>                 	
                    <div class="field pt15">
						<label>电话</label>
						<input class="text_input w15_input" type="text" name="telephone" id="telephone" value="{$data.telephone}" />
					</div>
                    <eq name="Think.session.administrator" value="true">
                    <div class="field pt15">
                        <label>是否为超级管理员</label>
                        <input type="checkbox" name="is_super"  value="1" <eq name="data.is_super" value="1"> checked</eq>/>是 
                    </div> 
                    </eq>                      
                    <div class="field pt15">
						<label>是否开放</label>
						<input type="checkbox" name="status"  value="1" <eq name="data.status" value="1"> checked</eq>/>是 
                        <small>默认开放</small>
					</div>                                                                                               
                    <div class="field pt15 clearfix">
                    	<input type="hidden" name="id" value="{$data.id}"/>   
                    	<input type="submit" value="提交" class="public_button fr" />
                    </div>                                                                               
                </form>
            </div>
        </div>            
        <!--发布结束-->
    </div>
</body>
</html>
